Skip to content

Reverse dependency on components#42

Closed
waralex wants to merge 6 commits into
devfrom
dependency_reverse
Closed

Reverse dependency on components#42
waralex wants to merge 6 commits into
devfrom
dependency_reverse

Conversation

@waralex

@waralex waralex commented Jun 12, 2020

Copy link
Copy Markdown
Contributor

DashBase.jl package added. Dash depends on DashBase and core components, core components depends on DashBase and other components depends on Dash.
For testing until the corresponding packages are added to the Registrator you need to install the packages in this order:

Pkg.add(PackageSpec(url="https://github.com/waralex/DashBase.jl.git"))
Pkg.add(PackageSpec(url="https://github.com/waralex/dash-html-components.git", rev="jl_reverse_test"))
Pkg.add(PackageSpec(url="https://github.com/waralex/dash-core-components.git", rev="jl_reverse_test"))
Pkg.add(PackageSpec(url="https://github.com/waralex/dash-table.git", rev="jl_reverse_test"))
Pkg.add(PackageSpec(url="https://github.com/plotly/Dash.jl.git", rev="dev"))

Corresponding PR to the generator plotly/dash#1302

If this option is accepted, then I will need to move the DashBase to the plotly repository. You will also need to update the jl branches for the main components

@waralex
waralex requested a review from alexcjohnson June 12, 2020 18:47
@github-actions github-actions Bot added enhancement New feature or request tests labels Jun 12, 2020
@waralex
waralex marked this pull request as draft June 12, 2020 18:47
@alexcjohnson

Copy link
Copy Markdown
Contributor

For testing until the corresponding packages are added to the Registrator you need to install the packages in this order

To confirm though, once they are added to the registry this will be just:

Pkg.add("dash")

And the other 4 come along automatically, correct? If so, this looks perfect!

Comment thread .circleci/config.yml
name: 🔎 Unit tests
command: |
julia -e 'using Pkg; Pkg.update(); Pkg.add(PackageSpec(url="https://github.com/plotly/Dash.jl.git", rev=ENV["CIRCLE_BRANCH"])); Pkg.add(PackageSpec(url="https://github.com/waralex/dash-html-components.git", rev="jl_generator_test")); Pkg.add(PackageSpec(url="https://github.com/waralex/dash-core-components.git", rev="jl_generator_test")); Pkg.build("Dash"); Pkg.build("DashHtmlComponents"); Pkg.build("DashCoreComponents"); Pkg.test("Dash", coverage=true); function precompile_pkgs(); for pkg in collect(keys(Pkg.installed())); if !isdefined(Symbol(pkg), :Symbol) && pkg != "Compat.jl"; @info("Importing $(pkg)..."); try (@eval import $(Symbol(pkg))) catch end; end; end; end; precompile_pkgs()'
julia -e 'using Pkg; Pkg.update(); Pkg.add(PackageSpec(url="https://github.com/waralex/DashBase.jl.git")); Pkg.add(PackageSpec(url="https://github.com/waralex/dash-html-components.git", rev="jl_reverse_test")); Pkg.add(PackageSpec(url="https://github.com/waralex/dash-core-components.git", rev="jl_reverse_test"));Pkg.add(PackageSpec(url="https://github.com/waralex/dash-table.git", rev="jl_reverse_test")); Pkg.add(PackageSpec(url="https://github.com/plotly/Dash.jl.git", rev=ENV["CIRCLE_BRANCH"])); Pkg.build("Dash");Pkg.test("Dash", coverage=true); function precompile_pkgs(); for pkg in collect(keys(Pkg.installed())); if !isdefined(Symbol(pkg), :Symbol) && pkg != "Compat.jl"; @info("Importing $(pkg)..."); try (@eval import $(Symbol(pkg))) catch end; end; end; end; precompile_pkgs()'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's awfully hard to tell what's changing here - perhaps we can move this to a separate .jl file? To make clear that it's meant only for CI we can put it in the .circleci folder - similar to what we do with the plotly.js test script.

@waralex

waralex commented Jun 12, 2020

Copy link
Copy Markdown
Contributor Author

@alexcjohnson

And the other 4 come along automatically, correct? If so, this looks perfect!

The user still needs to Pkg.add component packages if they plan to use them in their environment. In his entourage is added to the component version that satisfies the dependencies Dash. I.e. in Julia is 2 different actions - physical installation package and add a package to the current environment. Pkg.add(dash) physically install the component packages, but the user still needs to add them to their environment. The user does not need to add DashBase to their environment.

@alexcjohnson

Copy link
Copy Markdown
Contributor

As discussed on Slack, let's proceed with this. Aside from my comment about the unit test CI script this looks in good shape to me!

The only potential change I can think of after this is bundling the rest of the core as sub-packages of Dash - Dash.HtmlComponents instead of DashHtmlComponents. We don’t have to decide that now anyway, we can always do it later by importing and re-exporting them inside Dash. If we did that, the package structure would be different from Python and R, but we’d be back to a single-item installation. Also might be tricky to force unused sub-packages not to load their javascript, though for the core packages that’s not a big deal anymore since they all support async loading - the initial stubs are small.

@waralex

waralex commented Jun 15, 2020

Copy link
Copy Markdown
Contributor Author

@alexcjohnson Ok. I will move DashBase to the Plotly repository. On your part, you need to finish the generator (https://github.com/plotly/dash/tree/1189-julia-components) and update the jl branches of the components so that I can specify them in the README for the dev branch.

@rpkyle rpkyle linked an issue Aug 12, 2020 that may be closed by this pull request
@alexcjohnson

Copy link
Copy Markdown
Contributor

Is this PR obsolete now that we have #54?

@waralex

waralex commented Aug 27, 2020

Copy link
Copy Markdown
Contributor Author

Is this PR obsolete now that we have #54?

Yes, I'll close it

@waralex waralex closed this Aug 27, 2020
@etpinard
etpinard deleted the dependency_reverse branch June 13, 2023 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to version-lock Dash.jl and required core component libraries

2 participants